home *** CD-ROM | disk | FTP | other *** search
-
- ///////////////////////////////////////////////////////////////////////////////
- // Copyright 1995 by Potomac Software, Inc. Use of this material is subject to
- // the terms and conditions of the software license agreement.
-
- #ifndef __HTMLPAVC_INL__
- #define __HTMLPAVC_INL__
-
- ///////////////////////////////////////////////////////////////////////////////
- // Inline methods of CWeblibHtmlAPI class.
-
- inline CWeblibHtmlAPI::CWeblibHtmlAPI()
- {
- m_hParse = NULL;
- }
-
- inline CWeblibHtmlAPI::CWeblibHtmlAPI(LPCSTR lpszFilename,WORD wOptions)
- {
- m_hParse = WLHtmlParseFile(lpszFilename,wOptions);
- }
-
- inline CWeblibHtmlAPI::CWeblibHtmlAPI(LPCSTR lpszBuf,DWORD cbBuf,WORD wOptions)
- {
- if (cbBuf == 0)
- cbBuf = lstrlen(lpszBuf) + sizeof('\0');
- m_hParse = WLHtmlParseBuf(lpszBuf,cbBuf,wOptions);
- }
-
- inline BOOL CWeblibHtmlAPI::IsGood() const
- {
- return m_hParse != NULL;
- }
-
- inline BOOL CWeblibHtmlAPI::ParseFile(LPCSTR lpszFilename,WORD wOptions)
- {
- return (m_hParse = WLHtmlParseFile(lpszFilename,wOptions)) != NULL;
- }
-
- inline BOOL CWeblibHtmlAPI::ParseBuf(LPCSTR lpszBuf,DWORD cbBuf,WORD wOptions)
- {
- if (cbBuf == 0)
- cbBuf = lstrlen(lpszBuf) + sizeof('\0');
- return (m_hParse = WLHtmlParseBuf(lpszBuf,cbBuf,wOptions)) != NULL;
- }
-
- inline HELEMENT CWeblibHtmlAPI::GetChild(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetChild(m_hParse,hElement);
- }
-
- inline HELEMENT CWeblibHtmlAPI::GetParent(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetParent(m_hParse,hElement);
- }
-
- inline HELEMENT CWeblibHtmlAPI::GetSibling(HELEMENT hElement,WORD wRel) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetSibling(m_hParse,hElement,wRel);
- }
-
- inline UINT CWeblibHtmlAPI::GetElementType(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0 : WLHtmlGetElementType(m_hParse,hElement);
- }
-
- inline LPCSTR CWeblibHtmlAPI::GetElementText(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetElementText(m_hParse,hElement);
- }
-
- inline DWORD CWeblibHtmlAPI::GetTextAttr(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0L : WLHtmlGetTextAttr(m_hParse,hElement);
- }
-
- inline LPCSTR CWeblibHtmlAPI::GetTagName(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetTagName(m_hParse,hElement);
- }
-
- inline UINT CWeblibHtmlAPI::GetTagType(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0 : WLHtmlGetTagType(m_hParse,hElement);
- }
-
- inline HTAGATTR CWeblibHtmlAPI::GetTagAttr(HELEMENT hElement,HTAGATTR hTagAttr,WORD *pwType,
- LPSTR lpszAttr,UINT cbAttr,LPSTR lpszValue,UINT cbValue) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetTagAttr(m_hParse,hElement,hTagAttr,pwType,
- lpszAttr,cbAttr,lpszValue,cbValue);
- }
-
- inline LPCSTR CWeblibHtmlAPI::ExtractTagAttr(HELEMENT hElement,LPSTR lpszAttr) const
- {
- return m_hParse == NULL ? NULL : WLHtmlExtractTagAttr(m_hParse,hElement,lpszAttr);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindText(HELEMENT hElement,LPCSTR lpszText) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindText(m_hParse,hElement,lpszText);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindSpecial(HELEMENT hElement,LPCSTR lpszSpecial) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindSpecial(m_hParse,hElement,lpszSpecial);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindComment(HELEMENT hElement,LPCSTR lpszCommentText) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindComment(m_hParse,hElement,lpszCommentText);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindTagType(HELEMENT hElement,UINT nType) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagType(m_hParse,hElement,nType);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindTagName(HELEMENT hElement,LPCSTR lpszTag) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagName(m_hParse,hElement,lpszTag);
- }
-
- inline HELEMENT CWeblibHtmlAPI::FindTagAttr(HELEMENT hElement,UINT nType,LPCSTR lpszAttr,
- LPCSTR lpszValue) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagAttr(m_hParse,hElement,nType,lpszAttr,lpszValue);
- }
-
- ///////////////////////////////////////////////////////////////////////////////
- // Inline methods of CWeblibHtml class.
-
- #ifndef WEBLIB_NO_MFC
-
- inline BOOL CWeblibHtml::IsGood() const
- {
- return CWeblibHtmlAPI::IsGood() && m_pWnd != NULL && m_pWnd->m_hWnd != NULL;
- }
-
- inline BOOL CWeblibHtml::EnumParseTree(UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumParseTree(m_pWnd->m_hWnd,WM_WEBLIB_ENUMPARSETREE) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindText(HELEMENT hElement,LPCSTR lpszText,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindText(hElement,lpszText,m_pWnd->m_hWnd,
- WM_WEBLIB_ENUMFINDTEXT) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindSpecial(HELEMENT hElement,LPCSTR lpszSpecial,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindSpecial(hElement,lpszSpecial,m_pWnd->m_hWnd,
- WM_WEBLIB_ENUMFINDSPEC) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindComment(HELEMENT hElement,LPCSTR lpszComment,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindComment(hElement,lpszComment,m_pWnd->m_hWnd,
- WM_WEBLIB_ENUMFINDCOMM) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindTagType(HELEMENT hElement,UINT nType,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindTagType(hElement,nType,m_pWnd->m_hWnd,
- WM_WEBLIB_ENUMFINDTAGTYPE) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindTagName(HELEMENT hElement,LPCSTR lpszTag,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindTagName(hElement,lpszTag,m_pWnd->m_hWnd,
- WM_WEBLIB_ENUMFINDTAGNAME) &&
- PopEnumStack();
- }
-
- inline BOOL CWeblibHtml::EnumFindTagAttr(HELEMENT hElement,UINT nType,LPCSTR lpszAttr,
- LPCSTR lpszValueText,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- CWeblibHtmlAPI::EnumFindTagAttr(hElement,nType,lpszAttr,lpszValueText,
- m_pWnd->m_hWnd,WM_WEBLIB_ENUMFINDTAGATTR) &&
- PopEnumStack();
- }
-
- #endif // WEBLIB_NO_MFC
-
- #endif
-